/*
 * @lc app=leetcode.cn id=485 lang=csharp
 *
 * [485] 最大连续 1 的个数
 */

// @lc code=start
public class Solution {
    public int FindMaxConsecutiveOnes(int[] nums) {
        int max = 0;
        int count = 0;
        foreach (var num in nums)
        {
            if (num == 1)
            {
                ++count;
            }
            else
            {
                max = Math.Max(max, count);
                count = 0;
            }
        }
        return Math.Max(max, count);
    
    }
}
// @lc code=end

